﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

#region SAKRIJ OVO

namespace Snake.Client
{
    static class SimpleConsoleMenu
    {
        /*public static void Display()
        {
            Console.WriteLine
                (
                    "0) Exit\n" +
                    "1) Configure number of Players ({0})\n" +
                    "2) Configure speed of the game ({1})\n" +
                    "3) Configure screen resolution ({2} x {3})\n" +
                    "4) Configure mortality ratio ({4})\n" +
                        "hit ENTER to PLAY",
                    GameInfo.NumberOfPlayers,
                    GameInfo.Speed,
                    GameInfo.RequestedScreenWidth, GameInfo.RequestedScreenHeight,
                    GameInfo.HealthQuant
                );
            while (true)
            {
                var key = Console.ReadKey().Key;
                if (key == ConsoleKey.Enter)
                    return;

                Console.WriteLine("");
                string data = Console.ReadLine();
                int tmp;
                
                switch (key)
                {
                    case ConsoleKey.D1:
                        if (!int.TryParse(data, out tmp))
                        {
                            Console.WriteLine("Invalid Input!");
                            continue;
                        }
                        GameInfo.NumberOfPlayers = tmp;
                        break;
                    case ConsoleKey.D2:
                        break;
                    case ConsoleKey.D3:
                        break;
                    case ConsoleKey.D4:
                        break;
                }
            }
        }*/
        public static void RetardedMenu()
        {
            Console.WriteLine("just press ENTER to accept default values\n");

            Console.WriteLine("number of players? ({0})", GameInfo.NumberOfPlayers);
            try
            {
                GameInfo.NumberOfPlayers = int.Parse(Console.ReadLine());
            }
            catch
            {}

            Console.WriteLine("game speed? ({0})", GameInfo.Speed);
            try
            {
                GameInfo.Speed = int.Parse(Console.ReadLine());
            }
            catch
            {}

            Console.WriteLine("mortality? ({0})", GameInfo.HealthQuant);
            try
            {
                GameInfo.HealthQuant = double.Parse(Console.ReadLine());
            }
            catch 
            {}
            Console.WriteLine("screen width? ({0})", GameInfo.RequestedScreenWidth);
            try
            {
                GameInfo.RequestedScreenWidth = int.Parse(Console.ReadLine());
            }
            catch
            { }
            Console.WriteLine("screen height? ({0})", GameInfo.RequestedScreenHeight);
            try
            {
                GameInfo.RequestedScreenHeight = int.Parse(Console.ReadLine());
            }
            catch
            { }
        }
    }
}

#endregion
